<template>
    <div class="my-viewside">
        <template v-for="item in list">
            <template v-if="item.ChildList&&item.ChildList.length>0">
                <Submenu id="sub" :name="item.Path">
                    <template slot="title" >
                        <div class="touch" >
                            <img class="chilicon" :src="showIcon(item)">
                            <span>{{item.Name}}</span>
                        </div>
                    </template>
                    <menuItemSide :list="item.ChildList"></menuItemSide>
                </Submenu>
            </template>
            <template v-else>
                <MenuItem :name="item.Path" v-if="!item.ParentMod"><img class="showimg" :src="icon"><span>{{item.Name}}</span></MenuItem>
            </template>
        </template>
        <!-- :src="item.Path==chil.Path? icon2:icon" -->
    </div>
</template>

<script>
export default {
    name:'menuItemSide',
    data() {
        return {
            name:'',
            icon:require('../../assets/images/peach-svg/menu-icon/mu11.svg'),
            icon2:require('../../assets/images/peach-svg/menu-icon/mu12.svg'),
            chil:[]
        }
    },
    props: {
        list: {
            type: Array,
            default: []
        },
    },
    methods:{
        showIcon(item){
            let id = item.Path
            if(id=='sys'){
                return require('../../assets/images/peach-svg/menu-icon/mu1.svg')
            }
            if(id=='customer'){
                return require('../../assets/images/peach-svg/menu-icon/mu2.svg')
            }
            if(id=='number'){
                return require('../../assets/images/peach-svg/menu-icon/mu3.svg')
            }
            if(id=='log'){
                return require('../../assets/images/peach-svg/menu-icon/mu4.svg')
            }
            if(id=='sieve'){
                return require('../../assets/images/peach-svg/menu-icon/shuju.svg')
            }                                                                                                           
        },
    }
}
</script>

<style>

</style>